---克拉拉技能2
---* 对目标发动攻击，造成攻击力100%的伤害，目标身上每一个增、减益效果，会提高该技能[0]%的伤害，最高提升[1]%
---@class SkillEffect324100:BaseSkillEffect
SkillEffect324100 = ClientFight.CreateClass("SkillEffect324100",ClientFight.BaseSkillEffect)
local t = SkillEffect324100

---@param skill FightUsingSkill
---@param target Fighter
---@param result FightResult
function t:damageBefore(skill,target,result)
    if (not result:isDamage()) then
        return false;
    end

    local fight = skill.fight
    local skillTarget = skill.target
    local scripts = skill.skill.skillBean.f_SkillScriptParameter
    local buffs = skillTarget.buffs
    local add = 0;
    for k, buff in pairs(buffs) do
        if (buff.buffBean.f_BuffType == BuffTypeEnum.BENEFICIAL or
        buff.buffBean.f_BuffType() == BuffTypeEnum.NEGATIVE) then
            add = add + scripts[1];
        end
    end
    add = math.min(add, scripts[2]);
    local addDamage = math.floor(result:getDamage() * MathUtil.toRatio(add))
    --local logAdd = add;
   -- LogUtil.info( string.format("[%s][SKILL]克拉拉技能2 提升%s伤害,原伤害%s",
    --        fight.frame, logAdd, result.damage
   -- ));

    result:setDamage(result:getDamage() + addDamage);
    return false;
end

t.New()